<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="_base/_fragments :: head(title=~{::title/text()})">
<title>list</title>
</head>
<body>
	<div class="container">
		<div th:replace="_base/_fragments :: navbar"></div>
		<div class="float-right mt-2">
			<a class="btn btn-primary btn-sm" href="form.html" th:href="@{/(form)}">Create Message</a>
		</div>
		<h4 class="float-left mt-2">Messages List</h4>
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<th>ID</th>
					<th>Title</th>
					<th>Created</th>
				</tr>
			</thead>
			<tbody>
				<tr th:if="${messages.empty}">
					<td colspan="3">No messages</td>
				</tr>
				<tr th:each="message : ${messages}">
					<td th:text="${message.id}">1</td>
					<td><a href="view.html" th:href="@{'/' + ${message.id}}" th:text="${message.title}"> The Title</a></td>
					<td th:text="${#calendars.format(message.created,'yyyy-MM-dd HH:mm:ss')}">yyyy-MM-dd HH:mm:ss</td>
				</tr>
			</tbody>
		</table>
	</div>
	<script th:inline="javascript">
	 	var date = [[${#__.text('date')}]];
	 	console.log(date);
	</script>
</body>
</html>
